<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:60:"/data/www/jue/vdma/application/admin/view/news/news_img.html";i:1507703281;s:60:"/data/www/jue/vdma/application/admin/view/public/header.html";i:1507685936;}*/ ?>
<!doctype html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
</head>
<body>

	<link rel="stylesheet" href="__STATIC__/css/reset.css">
	<link rel="stylesheet" href="__STATIC__/css/weui/weui.css">
	<link rel="stylesheet" href="__STATIC__/css/weui/weui2.css">

	<style>
	* {
		font-family: "microsoft yahei";
		word-wrap: break-word;
		margin: 0;
		padding: 0;
		-webkit-tap-highlight-color: transparent;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		box-sizing: border-box!important;
	}
	input, textarea{max-width: 30%;float: left;}	
	.parsley-errors-list{float: left;max-width: 45%;}
	button, input, optgroup, select, textarea {
		color: inherit;
	}
	input:focus{
		-webkit-user-select: none;  /* Chrome all / Safari all */
		-moz-user-select: none;     /* Firefox all */
		-ms-user-select: none;      /* IE 10+ */
		-o-user-select: none;
		user-select: none;  
		border:1px solid #00b38a;
	}
	
	textarea:focus{
		-webkit-user-select: none;  /* Chrome all / Safari all */
		-moz-user-select: none;     /* Firefox all */
		-ms-user-select: none;      /* IE 10+ */
		-o-user-select: none;
		user-select: none;  
		border:1px solid #00b38a;
	}
	select:focus{
		 border:1px solid #00b38a;
		 -webkit-user-select: none;  /* Chrome all / Safari all */
		  -moz-user-select: none;     /* Firefox all */
		  -ms-user-select: none;      /* IE 10+ */
		  -o-user-select: none;
		  user-select: none;  
	}
	input, select, textarea:focus{
		outline:none;
	}
	.main-wrap{padding: 20px;}
	.form-group-col-2 {
		margin-bottom: 15px;
		overflow: hidden
	}
	.form-group-col-2 .form-label {
		float: left;
		display: block;
		padding: 6px 15px!important;
		font-size: 14px !important;
		width: 120px;
		font-weight: 400;
		text-align: right;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		
	}
	.form-group-col-2:after {
		content: " ";
		display: block;
		height: 0;
		clear: both;
		visibility: hidden;
	}
	.form-group-col-2 .form-cont {
		margin-left: 120px;
		min-height: 33px;
	}
	.form-boxed {
		border-radius: 0;
		box-shadow: none;
	}
	.form-control {
		padding: 6px 15px!important;
		font-size: 14px !important;
		display: inline-block;
		width: 100%;
		color: black;
		background-color: #fff;
		border: 1px solid rgba(204, 204, 204, 0.75);;
		line-height: normal;
	}
	.form-group-col-2 .word-aux {
		display: inline-block;
		padding: 6px 0;
		color: #ccc;
	}
	
		.btn-primary {
			background: #00b38a;
			border-color: #00b38a;
			color: white;
		}
		.btn {
			-webkit-user-select: none;
			padding: 6px 15px!important;
			font-size: 14px !important;
			display: inline-block;
			border: none;
			font-weight: normal;
			line-height: normal;
			text-align: center;
			border: 1px solid transparent;
			letter-spacing: 2px;
			white-space: nowrap;
			cursor: pointer;
		}
		select {
			padding: 5px 10px;
			display: inline-block;
			width: 100%;
			border: 1px solid #ccc;
			cursor: pointer;
		}
		.parsley-error {
				border-color: #f43530; !important;
			}
		
		.weui_cell{float:left;border:none; !important}
		.weui_cell_ft{text-align:left; !important}
		
		 .parsley-required,.parsley-type{  
			display: inline-block;
			padding: 6px 0;
			color: #c00;
		}

		.stepbar{height:80px;}
		.order-stepbar {
			position: absolute;
			top: 0;
			right: 0;
			width: auto;
			padding: 20px 0 0;
			margin: 0 auto;
			overflow: hidden;
			zoom: 1;
		}
	.order-stepbar li {
    float: left;
    text-align: center;
}
.stepbar-4 li {
    width: 182px;
}
.step-name {
    padding: 3px 0;
    font-weight: 700;
    color: #888;
}
.step-no {
    height: 34px;
    line-height: 34px;
    font-family: 'arial black';
    color: #fff;
    font-size: 18px;
}
.step-first .step-done .step-no {
    background-position: 50% -204px;
}    
.order-stepbar .step-no {
    background: url(__IMG__/icon/step.png) 50% -102px no-repeat;
}



</style>



<div class="content">
    <div class="main-wrap">
        <form action="<?php echo url('news_img'); ?>" class="parsley-validate" enctype="multipart/form-data" method="post">
            <input type="text" value="<?php echo $data['id']; ?>" hidden name="id">

            <div class="form-group-col-2">
                <div class="form-label">新闻图:</div>
                <div class="form-cont" >
                    <input type="file" name="image" id="file0"  /><br><p style="color:#ccc">(图片大小为 3MB 以内)</p>
                    <img src="/vdma/public/uploads/<?php echo $data['news_img']; ?>" id="img0" style="width: 150px">
                </div>
            </div>
            <div class="form-group-col-2">
                <div class="form-label"></div>
                <div class="form-cont">
                    <input type="submit" class="btn btn-primary" value="保存"/>
                </div>
            </div>

        </form>
    </div>
</div>


<!--form validation js -->
<script src="__STATIC__/js/common/jquery.js"></script>
<script src="__STATIC__/js/parsley.js"></script>
<script src="__STATIC__/js/zh_cn.js"></script>
<script>
    $('.parsley-validate').parsley();//调用parsley表单验证插件
</script>
<!--新闻图预览及上传-->
<script>
    $("#file0").change(function(){
        // getObjectURL是自定义的函数，见下面
        // this.files[0]代表的是选择的文件资源的第一个，因为上面写了 multiple="multiple" 就表示上传文件可能不止一个
        // ，但是这里只读取第一个
        var objUrl = getObjectURL(this.files[0]) ;
        // 这句代码没什么作用，删掉也可以
        // console.log("objUrl = "+objUrl) ;
        if (objUrl) {
            // 在这里修改图片的地址属性
            $("#img0").attr("src", objUrl) ;
        }
    }) ;
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        // 下面函数执行的效果是一样的，只是需要针对不同的浏览器执行不同的 js 函数而已
        if (window.createObjectURL!=undefined) { // basic
            url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }

</script>
<!--banner图预览及上传-->
<script>
    $("#file1").change(function(){
        // getObjectURL是自定义的函数，见下面
        // this.files[0]代表的是选择的文件资源的第一个，因为上面写了 multiple="multiple" 就表示上传文件可能不止一个
        // ，但是这里只读取第一个
        var objUrl = getObjectURL(this.files[0]) ;
        // 这句代码没什么作用，删掉也可以
        // console.log("objUrl = "+objUrl) ;
        if (objUrl) {
            // 在这里修改图片的地址属性
            $("#img1").attr("src", objUrl) ;
        }
    }) ;
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        // 下面函数执行的效果是一样的，只是需要针对不同的浏览器执行不同的 js 函数而已
        if (window.createObjectURL!=undefined) { // basic
            url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }

</script>
</body>
</html>